﻿Ext.define('Admin.view.leave.LeaveGrid', {
    extend: 'Ext.grid.Panel',
	xtype:'leave-grid',
	title: '流程部署',
	iconCls: 'fa-arrow-circle-o-up',
	//cls: 'user-grid',
	
	controller: 'leave',			//视图控制器
    viewModel : { type: 'leave'},	//视图数据模型
	bind: '{leaveGridStore}',		//viewModeld的store
	//sm:new Ext.grid.CheckboxSelectionModel(),
	columns: [
		  	{header: 'id' 			,dataIndex: 'id',width: 60,sortable: true	,hidden:true}
		  ,{header: 'userId'  		,dataIndex: 'userId',width: 60,sortable: true}
		  ,{header: 'startTime' 	,dataIndex: 'startTime',width: 120,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
		  ,{header: 'endTime' 			,dataIndex: 'endTime',width: 120,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
		  //,{header: 'realityStartTime' 	,dataIndex: 'realityStartTime',width: 60,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
		  //,{header: 'realityEndTime' 	,dataIndex: 'realityEndTime',width: 60,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
		  //,{header: 'applyTime' 	,dataIndex: 'applyTime',width: 180,sortable: true,renderer: Ext.util.Format.dateRenderer('Y/m/d H:i:s')}
		  ,{header: 'leaveType'  	,dataIndex: 'leaveType',width: 60,sortable: true}
		  ,{header: 'reason' 		,dataIndex: 'reason',width: 180,sortable: true}
		  // ,{header: 'processInstanceId' ,dataIndex: 'processInstanceId',width: 180,sortable: true}
	],
	dockedItems: [{
	    xtype: 'pagingtoolbar',
	    dock: 'bottom',
		bind: '{leaveGridStore}',	//viewModeld的store
	    displayInfo: true,
	    items: ['-',{
            text: 'Add',
            iconCls: 'x-fa fa-plus',
			listeners: {
				click: 'onClickLeaveGridAddButton'
            }
        }, '-',{
            text: 'Update',
            iconCls: 'x-fa fa-pencil',
            listeners: {
				click: 'onClickLeaveGridUpdateButton'
            }
        }, '-', {
            text: 'Delete',
            iconCls: 'x-fa fa-close',
			listeners: {
				click: 'onClickLeaveGridDeleteButton'
            }
        }, '-', {
            text: '申请审批',
            iconCls: 'x-fa fa-arrow-up',
            listeners: {
				click: 'onClickStartButton'
            }
        }]
	}]
});
